using System;
using System.Web;

namespace time
{
    public class work_encode
    {
        public static void Main()
        {
            while (true)
            {
                Console.WriteLine("1:encode   2:decode");
                string s = Console.ReadLine();
                if (s == "1")
                {
                    Console.WriteLine("please input string");
                    string d = Console.ReadLine();
                    d = HttpUtility.UrlEncode(d);
                    System.IO.StreamWriter sw = new System.IO.StreamWriter("1.txt");
                    sw.WriteLine(d);
                    sw.Flush();
                    System.Diagnostics.Process.Start("1.txt");
                }
                else if (s == "2")
                {
                    Console.WriteLine("please input string");
                    string d = Console.ReadLine();
                    d = HttpUtility.UrlDecode(d);
                    System.IO.StreamWriter sw = new System.IO.StreamWriter("1.txt");
                    sw.WriteLine(d);
                    sw.Flush();
                    System.Diagnostics.Process.Start("1.txt");
                }
            }
            //d = HttpUtility.UrlDecode("Cookie: __utma=1.1796998208.1323080225.1323312472.1323410744.10; __utmz=1.1323167393.5.3.utmcsr=returns.vancl.com|utmccn=(referral)|utmcmd=referral|utmcct=/ExStepOne/StepOne/111120600056; __utma=92199193.1059243903.1314081197.1323076332.1323410144.71; __utmz=92199193.1323410144.71.62.utmcsr=my.vancl.com|utmccn=(referral)|utmcmd=referral|utmcct=/; _vuca=9ABE11F5937F4C8E9D1197427F8ADC80; _vucc=111; Vancl-Track-Info=836a4fbaff0145ad8f9f6111f2fee9e6@1315991614@1315991614; cart_tips_show_switch=1; VisitedCookies=0000556,0008018,0160522,0166265,0001923,0001920; ShoppingBackUrl=http%3A//item.vancl.com/0008018.html; ShoppingCarInfo=0$7; ForOrder_log=; ShoppingCar_Address=5344339$7935146$Inland$false; Transfercookie=01$7935146$Inland; Transfer_Timecookie=2$7935146$Inland; UserBankPay=06$7935146; Paymentcookie=01$7935146$Inland; CashonDeliveryTypeCookie=1$7935146; BankIDcookie=$7935146; UserLogin=UserID=yVxFMeN1FeB7FAV96RhXsw==&UserName=cJXk0YOVOPlmaO3RDRecNQ==&NewUserName=cJXk0YOVOPlmaO3RDRecNQ==&UserType=w+cpdiT6wL4=&LevelID=M40FsP+6CcI=&IsOld=M40FsP+6CcI=&myGuid=GcgD7pshHMdY4nben3mThhsj4sP8LFfpcnjL9idAwo96clp4fbVeKQ==; __utmb=92199193.3.10.1323410144; Status=%e8%bf%9b%e8%a1%8c%e4%b8%ad; PostTime=30; __utmb=1.3.10.1323410744; sid=39B9D3CC1938439AAF40D0B35203B965; _vucb=1; Vancl.Returns_42882637_111120800011=stepone=%7b%22ReturnList%22%3a%5b%7b%22Count%22%3a0%2c%22ExchangedContrastList%22%3a%5b%7b%22Count%22%3a10%2c%22SwapOutSku%22%3a%2200003076%22%7d%5d%2c%22Reason%22%3a%2215%22%2c%22ReturnLineID%22%3a8430%2c%22ReturnSku%22%3a%2200003076%22%7d%5d%7d&steptwo=%7b%22Addressee%22%3a%22kaku023%22%2c%22Area%22%3a%7b%22aid%22%3a%22110101%22%2c%22aName%22%3a%22%e4%b8%9c%e5%9f%8e%e5%8c%ba%22%2c%22postalCode%22%3anull%7d%2c%22City%22%3a%7b%22cid%22%3a%22110100%22%2c%22cName%22%3a%22%e5%8c%97%e4%ba%ac%e5%b8%82%22%7d%2c%22CustomAddr%22%3a%22test%22%2c%22MobilePhone%22%3a%2213312345678%22%2c%22OpeType%22%3a1%2c%22Phone%22%3a%22%22%2c%22PostalCode%22%3a%22100010%22%2c%22Province%22%3a%7b%22pid%22%3a%22110000%22%2c%22pName%22%3a%22%e5%8c%97%e4%ba%ac%22%7d%2c%22SendTime%22%3a%22%e5%b7%a5%e4%bd%9c%e6%97%a5%e3%80%81%e5%8f%8c%e4%bc%91%e6%97%a5%e4%b8%8e%e5%81%87%e6%97%a5%e5%9d%87%e5%8f%af%e9%80%81%e8%b4%a7%22%2c%22WareHouseType%22%3a0%7d");

            //string d = System.Web.HttpContext.Current.Server.UrlDecode("__utma=1.1796998208.1323080225.1323309029.1323312472.9; __utmz=1.1323167393.5.3.utmcsr=returns.vancl.com|utmccn=(referral)|utmcmd=referral|utmcct=/ExStepOne/StepOne/111120600056; __utma=92199193.1059243903.1314081197.1323051474.1323076332.70; __utmz=92199193.1323076332.70.61.utmcsr=my.vancl.com|utmccn=(referral)|utmcmd=referral|utmcct=/Order/; _vuca=9ABE11F5937F4C8E9D1197427F8ADC80; _vucc=109; Vancl-Track-Info=836a4fbaff0145ad8f9f6111f2fee9e6@1315991614@1315991614; cart_tips_show_switch=1; VisitedCookies=0160522,0166265,0001923,0001920,0160567,0166271; ShoppingBackUrl=http%3A//www.vancl.com/; ShoppingCarInfo=0$0; ForOrder_log=; ShoppingCar_Address=5344339$7935146$Inland$false; Transfercookie=01$7935146$Inland; Transfer_Timecookie=2$7935146$Inland; UserBankPay=06$7935146; Paymentcookie=01$7935146$Inland; CashonDeliveryTypeCookie=1$7935146; BankIDcookie=$7935146; sid=2AD16145DC8D48A9A39A06001E88823D; _vucb=1; Vancl.Returns_42882570_111110900012=stepone=%7b%22ReturnList%22%3a%5b%7b%22Count%22%3a0%2c%22ExchangedContrastList%22%3a%5b%7b%22Count%22%3a1%2c%22SwapOutSku%22%3a%2200033647%22%7d%5d%2c%22Reason%22%3a%22173%22%2c%22ReturnLineID%22%3a7671%2c%22ReturnSku%22%3a%2200033619%22%7d%5d%7d&steptwo=%7b%22Addressee%22%3a%22ceshi%22%2c%22Area%22%3a%7b%22aid%22%3a%22110105%22%2c%22aName%22%3a%22%e6%9c%9d%e9%98%b3%e5%8c%ba%22%2c%22postalCode%22%3anull%7d%2c%22City%22%3a%7b%22cid%22%3a%22110100%22%2c%22cName%22%3a%22%e5%8c%97%e4%ba%ac%e5%b8%82%22%7d%2c%22CustomAddr%22%3a%22%e6%b5%8b%e8%af%95%e5%9c%b0%e5%9d%80%22%2c%22MobilePhone%22%3a%22%22%2c%22OpeType%22%3a1%2c%22Phone%22%3a%2201012345632%22%2c%22PostalCode%22%3a%22100020%22%2c%22Province%22%3a%7b%22pid%22%3a%22110000%22%2c%22pName%22%3a%22%e5%8c%97%e4%ba%ac%22%7d%2c%22SendTime%22%3a%22%e5%b7%a5%e4%bd%9c%e6%97%a5%e3%80%81%e5%8f%8c%e4%bc%91%e6%97%a5%e4%b8%8e%e5%81%87%e6%97%a5%e5%9d%87%e5%8f%af%e9%80%81%e8%b4%a7%22%2c%22WareHouseType%22%3a0%7d; Status=%e8%bf%9b%e8%a1%8c%e4%b8%ad; PostTime=30; UserLogin=UserID=yVxFMeN1FeB7FAV96RhXsw==&UserName=cJXk0YOVOPlmaO3RDRecNQ==&NewUserName=cJXk0YOVOPlmaO3RDRecNQ==&UserType=w+cpdiT6wL4=&LevelID=M40FsP+6CcI=&IsOld=M40FsP+6CcI=&myGuid=Ew+CI8peRiiMGvaNDlhvXe46oeydR3Yoovnphp/n7iF5cj2ljNokbw==; Vancl.Returns_42882637_111120800071=stepone=%7b%22ReturnList%22%3a%5b%7b%22Count%22%3a0%2c%22ExchangedContrastList%22%3a%5b%7b%22Count%22%3a1%2c%22SwapOutSku%22%3a%2200253678%22%7d%5d%2c%22Reason%22%3a%22174%22%2c%22ReturnLineID%22%3a8468%2c%22ReturnSku%22%3a%2200105839%22%7d%5d%7d&steptwo=%7b%22Addressee%22%3a%22kaku023%22%2c%22Area%22%3a%7b%22aid%22%3a%22110101%22%2c%22aName%22%3a%22%e4%b8%9c%e5%9f%8e%e5%8c%ba%22%2c%22postalCode%22%3anull%7d%2c%22City%22%3a%7b%22cid%22%3a%22110100%22%2c%22cName%22%3a%22%e5%8c%97%e4%ba%ac%e5%b8%82%22%7d%2c%22CustomAddr%22%3a%22test%22%2c%22MobilePhone%22%3a%2213312345678%22%2c%22OpeType%22%3a1%2c%22Phone%22%3a%22%22%2c%22PostalCode%22%3a%22100010%22%2c%22Province%22%3a%7b%22pid%22%3a%22110000%22%2c%22pName%22%3a%22%e5%8c%97%e4%ba%ac%22%7d%2c%22SendTime%22%3a%22%e5%b7%a5%e4%bd%9c%e6%97%a5%e3%80%81%e5%8f%8c%e4%bc%91%e6%97%a5%e4%b8%8e%e5%81%87%e6%97%a5%e5%9d%87%e5%8f%af%e9%80%81%e8%b4%a7%22%2c%22WareHouseType%22%3a0%7d");
            //Console.Write(d);

            Console.Read();
        }
    }
}